const Router = require('koa-router')
const router = new Router()
const koaBody = require('koa-bodyparser');

const home = require('../model/home')

router.prefix('/home');


router.post('/today-recommend',koaBody(), async ctx => {
      const numRecommendations =  8; // 默认获取8个推荐
      
      // 查询数据库获取推荐
      const rows = await home.GETTODAYREC(numRecommendations);
      ctx.body = rows;
    }
)
router.post('/today-wordocean',koaBody(), async ctx => {
  const numRecommendations =  30; // 默认获取8个推荐
  
  // 查询数据库获取推荐
  const rows = await home.GETOCEAN(numRecommendations);
  console.log("row:",rows)
  ctx.body = rows;
}
)
  module.exports = router